/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-10
 * Time: 15:45
 */

class Book{
    private String name;
    static int num;
    private double price;
    private int count;
    Book(){
        num++;
        this.count=num;
    }
    Book(String name,double price){
        this();
        this.name=name;
        this.price=price;
    }

    public String getName() {
        return name;
    }

    public int getCount() {
        return count;
    }

    public double getPrice() {
        return price;
    }

    @Override
    public String toString() {
        return "编号："+getCount()+"，书名："+getName()+"，价格："+getPrice();
    }
}

public class Main {
    public static void main(String[] args) {

        Book b[]=new Book[5];
        b[0]=new Book("java程序设计教程",105.5);
        b[1]=new Book("高数教程" ,99.5);
        b[2]=new Book("英语教程",56.5);
        b[3]=new Book("图形设计教程",98.8);
        b[4]=new Book("网络教程",119.4);

        for(int i=0;i<b.length;i++) {
            System.out.println(b[i].toString());
        }
    }
}
/* 请在这里填写答案 */
